import type { VxeTableGridOptions } from '#/adapter/vxe-table';

import { DICT_TYPE } from '@vben/constants';

import { $t } from '#/locales';

/** 详情列表的字段 */
export function useDetailListColumns(): VxeTableGridOptions['columns'] {
  return [
    {
      title: $t('views.crm.receivable.no'),
      field: 'no',
      minWidth: 150,
      fixed: 'left',
    },
    {
      title: $t('views.crm.common.customer'),
      field: 'customerName',
      minWidth: 150,
    },
    {
      title: $t('views.crm.contract.contractNo'),
      field: 'contract.no',
      minWidth: 150,
    },
    {
      title: $t('views.crm.receivable.returnTime'),
      field: 'returnTime',
      minWidth: 150,
      formatter: 'formatDateTime',
    },
    {
      title: $t('views.crm.receivable.price'),
      field: 'price',
      minWidth: 150,
      formatter: 'formatAmount2',
    },
    {
      title: $t('views.crm.receivablePlan.returnType'),
      field: 'returnType',
      minWidth: 150,
      cellRender: {
        name: 'CellDict',
        props: { type: DICT_TYPE.CRM_RECEIVABLE_RETURN_TYPE },
      },
    },
    {
      title: $t('views.crm.common.ownerUserId'),
      field: 'ownerUserName',
      minWidth: 150,
    },
    {
      title: $t('common.remark'),
      field: 'remark',
      minWidth: 150,
    },
    {
      title: $t('views.crm.receivable.auditStatus'),
      field: 'auditStatus',
      minWidth: 100,
      fixed: 'right',
      cellRender: {
        name: 'CellDict',
        props: { type: DICT_TYPE.CRM_AUDIT_STATUS },
      },
    },
    {
      title: $t('common.action'),
      field: 'actions',
      width: 130,
      fixed: 'right',
      slots: { default: 'actions' },
    },
  ];
}
